home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
win_q_t
/
trem.zip
/
CURSOR.C
< prev
next >
Wrap
Text File
|
1991-05-11
|
2KB
|
59 lines
/************************************************************************
*
* Copyright (c) 1991 Microsoft Corporation. All Rights Reserved.
*
*-----------------------------------------------------------------------
*
* Project: Windows Terminal Example
*
* Module: cursor.c
*
* Author: Bryan A. Woodruff (baw)
*
*
* Remarks: This function controls caret movement.
*
* Revisions:
* 01.00.000 5/ 9/91 baw Wrote it.
*
************************************************************************/
#include "terminal.h"
/************************************************************************
* BOOL MoveTerminalCursor( HWND hWnd )
*
* Description:
* Moves caret to current position.
*
* Comments:
* 5/ 9/91 baw Wrote it.
*
************************************************************************/
BOOL MoveTerminalCursor( HWND hWnd )
{
LOCALHANDLE hTermInfo ;
NPTERMINFO npTermInfo ;
hTermInfo = GetWindowWord( hWnd, GWW_TERMINFO ) ;
if (NULL == (npTermInfo = (NPTERMINFO) LocalLock( hTermInfo )))
return ( FALSE ) ;
if (npTermInfo -> fConnected && (npTermInfo -> wCursorState & CS_SHOW))
SetCaretPos( (npTermInfo -> nColumn * npTermInfo -> xChar) -
npTermInfo -> xOffset,
(npTermInfo -> nRow * npTermInfo -> yChar) -
npTermInfo -> yOffset ) ;
LocalUnlock( hTermInfo ) ;
return ( TRUE ) ;
} /* end of MoveTerminalCursor() */
/************************************************************************
* End of File: cursor.c
************************************************************************/